print: disconnect source_changed_handler on printeroptionwidget finalize
authorAlban Browaeys <prahal@yahoo.com>
Thu, 21 Mar 2013 08:45:32 +0000 (09:45 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 15 Apr 2013 00:20:14 +0000 (20:20 -0400)
Printing a web page without window.print (which still segfault),
that is Ctrl+P is fixed (does not attempt to execute the
source_changed_handler on a printeroptionwidget that has been
destroyed) by disconnecting this handler in the printeroptionwidget
finalize.

https://bugzilla.gnome.org/show_bug.cgi?id=696622

gtk/gtkprinteroptionwidget.c

index 44c54adf7c5f265fb7f8bc9abd4191847cecbd64..36b8c9d0a3b3f1f9248b9253604c1926d2e093b7 100644 (file)
@@ -152,6 +152,8 @@ gtk_printer_option_widget_finalize (GObject *object)
   
   if (priv->source)
     {
+      g_signal_handler_disconnect (priv->source,
+                                  priv->source_changed_handler);
       g_object_unref (priv->source);
       priv->source = NULL;
     }